<?php
/**
* @package SJ Tabs module 
* @author http://www.sjtemplates.com
* @copyright (C) 2010- sjtemplates.Com
* @license PHP files are GNU/GPL
**/
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die( 'Restricted access' ); 
jimport('joomla.form.formfield');
class JFormFieldJvType extends JFormField {

var	$type = 'JvType';

function getInput(){
return JElementJvType::fetchElement($this->name, $this->value, $this->element, $this->options['control']);
} 
} 
jimport('joomla.html.parameter.element');
class JElementJvType extends JElement
{ 
var	$_name = 'JvType';

function fetchElement($name, $value, &$node, $control_name)
{	
$options = array ();
$db =& JFactory::getDBO();  
$val = "";
$text = "- Select type -";
$options[] = JHTML::_('select.option', $val, JText::_($text));
$val = "moduleID";
$text = "Modules";
$options[] = JHTML::_('select.option', $val, JText::_($text));
$val = "categoryID";
$text = "Contents";
$options[] = JHTML::_('select.option', $val, JText::_($text));
$val = "k2_content";
$text = "K2 Contents";
$options[] = JHTML::_('select.option', $val, JText::_($text)); 

$class = ( $node->attributes('class') ? 'class="'.$node->attributes('class').'"' : 'class="inputbox"' );
//$class .= " onchange=\"javascript: switchGroup(this)\""; 
$str = JHTML::_('select.genericlist',  $options, ''.$this->name.'', $class, 'value', 'text', $value, $control_name.$name);		

$cId = JRequest::getVar('cid','');
if($cId !='') $cId = $cId[0];
if($cId == ''){
$cId = JRequest::getVar('id');
}
$sql = "SELECT params FROM #__modules WHERE id=$cId";
$db->setQuery($sql);
$paramsConfigObj = $db->loadObjectList();
$db->setQuery($sql);
$data = $db->loadResult();
$params = new JParameter($data);
$tabType = $params->get('type','moduleID');	
$viewContent = $params->get('categoryID-view','word_count');
$effectType = $params->get('st_tabs_style','sj_default');	
?>

<?php 	
return $str;
}
} 
?>
